package com.lefeee.paperrec;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity {

    TextView tv_log;
    Button btn_test;

    private <T extends View> T $(int id) {
        return (T) findViewById(id);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        final NetCall netCall = new NetCall();

        tv_log = (TextView) findViewById(R.id.tv_log);

        btn_test = (Button) $(R.id.btn_get);
        btn_test.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                new Thread() {
                    public void run(){
                        String ret = netCall.getUser();
                       // tv_log.setText(" " + ret);
                        Log.d("cw_get", "ret: " + ret);
                    }
                }.start();
            }
        });

    }
}
